﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ExportDocumentFile.ascx.vb" Inherits="Control_MSDS_ExportDocumentFile" %>

		<div id="generate" style="width: 280px; margin: 0 auto;">
			<div style="clear:both;padding-top:20px"></div>
			<div class="DivRow">
				<div class="DivTextBox">
					<asp:Button ID="btnExport" runat="server" Text=" ExportFile " CssClass="btn" />
				</div>
			</div>
			<div style="display: none">
				<asp:HiddenField ID="hidMSDSID" Value="0" runat="server" />
				<asp:HiddenField ID="hidLink" Value="" runat="server" ClientIDMode="Static" />
			</div>
		</div>
    
<script type="text/javascript">
	$(function () {
		$("#btnAcept,#msbox1_image").unbind("click");
		$("#btnAcept,#msbox1_image").one("click", function () {
			var urlRedirect = $("#hidLink").val();
			window.location.href = urlRedirect;
		})
	});
	function ExportSuccessFull(_urlDowload, urlRedirect) {
		$("#hidLink").val(urlRedirect);
		Alertbox('Xuất dữ liệu thành công.');
		window.open(_urlDowload, '_blank');

		//window.location.href = _urlDowload;
		//setTimeout(function () {
		//	window.location.href = urlRedirect;
		//}, 5000);
}

function writeSwf(swf) {
    open_window_max('Viewer.aspx?swf=' + swf, 'viewer');
}

function open_iframe(aURL, aWinName) {
    document.getElementById('expFile').src = aURL;
}

function open_window_max(aURL, aWinName) {
    var wOpen;
    var sOptions;

    sOptions = 'status=no,menubar=no,scrollbars=auto,resizable=no,toolbar=no,fullscreen=yes';
    sOptions = sOptions + ',width=' + (screen.availWidth - 0).toString();
    sOptions = sOptions + ',height=' + (screen.availHeight - 0).toString();
    sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';

    wOpen = window.open('', aWinName, sOptions);
    wOpen.location = aURL;
    wOpen.focus();
    wOpen.moveTo(0, 0);
    wOpen.resizeTo(screen.availWidth, screen.availHeight);
    return wOpen;
}

</script>
